<?php 
$url='http://cdn.mei94.com/p/doc/f2';
if('localhost' == $_SERVER['HTTP_HOST'] || '192.168.3.3' == $_SERVER['HTTP_HOST']){
	$url='.';
}
$sheng=json_decode(file_get_contents('./api/city.txt'), true);
$_SESSION['code']=rand(1112,9998);
include_once 'jssdk.php';
$jssdk = new JSSDK($appId, $secret);
$signPackage = @$jssdk->GetSignPackage();
?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<title>德尔地板，天降豪礼 全球狂欢</title>
<link href="http://cdn.mei94.com/public/h/s2/css/animate.3.css" rel="stylesheet">
<style>
html,body{width:100%;font-size:12px;font-family:Microsoft YaHei, Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;}
body{position:relative;background:#05051d;}
body, div{padding:0px;margin:0px auto;max-width:750px;}
-webkit-touch-callout:none;
-webkit-user-select:none;
html{-ms-touch-action:none;}
div,img{-webkit-tap-highlight-color:rgba(0,0,0,0);}
*{-webkit-text-size-adjust: none;}
.simg{position:absolute;display:block;}
a{text-decoration:none;}
.txt{position:absolute;text-indent:8px;color:#000;font-size:12px;z-index:2;border:none;background:transparent;}
.txt::-webkit-input-placeholder {text-align:left;}
select{position:absolute;color:#000;display:block;background:transparent;border:0px;text-indent:10px;font-size:12px;-webkit-appearance:none;}
.container{position:relative;width:100%;height:auto;/**overflow:hidden;*/}
.page{position:absolute;width:100%;height:100%;display:none;}
.p-bg{position:absolute;width:100%;height:100%;top:0;left:0;}
.bg-size{position:absolute;width:100%;top:0;left:0;}
.fade-in{opacity:1;-webkit-transition:opacity 1s ease-in-out;-moz-transition: opacity 1s ease-in-out;-o-transition: opacity 1s ease-in-out;transition: opacity 1s ease-in-out;}
.hide{display:none;}
img{pointer-event:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;}
.animated.delay-d1s{-webkit-animation-delay:.2s;animation-delay:.2s;}
.animated.delay-d2s{-webkit-animation-delay:.3s;animation-delay:.3s;}
.animated.delay-d5s{-webkit-animation-delay:.5s;animation-delay:.5s;}
.home, .p2, .p3, .p4, .p9, .p5, .chou{background:transparent url('<?php echo $url ?>/img/bg.jpg') no-repeat;background-size:cover;}
.me{background:#fff;}
.me-t2{position:absolute;left:0;background:transparent url('<?php echo $url ?>/img/me-t2.png') no-repeat;background-size:cover;}
.me-j{position:absolute;width:100%;left:0;}
.me-j img{display:block;}
.reg{background:transparent url('<?php echo $url ?>/img/reg.jpg') no-repeat;background-size:cover;}
.reg-t3{position:absolute;left:0;background:transparent url('<?php echo $url ?>/img/reg-t3.png') no-repeat;background-size:cover;}
.citypicker{position:absolute;left:0;top:0;}
.reg-txt{position:absolute;text-align:center;display:none;}

.chou-cishu{position:absolute;width:100%;text-align:center;font-size:12px;color:#fff;}
.chou-cishu span{color:#feef52}
.chou-t2{position:absolute;background:transparent url('<?php echo $url ?>/img/chou-t2.png') no-repeat;background-size:cover;}
.gogray{-webkit-filter: grayscale(100%);filter: grayscale(100%);}
.t-bg{position:absolute;display:none;width:100%;height:100%;top:0px;left:0px;background-color:#000;opacity:.8;z-index:6;}
.t-jp{position:absolute;display:none;width:100%;height:100%;top:0px;left:0px;z-index:9;}
.toast{position:fixed;display:none;top: 40%;left: 0;right: 0;text-align: center;width: 100%;z-index: 1000;}
.toast .text-wrapper{font-size: 14px;margin: auto;border-radius: 8px;background-color: rgba(0, 0, 0, 0.6);color: #fff;padding:2% 6% 2% 6%;max-width: 50%;display: inline-block;}
.p-logo, .p2-t1{z-index:2;}
</style><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?22eda3a7d09eccab64082e062d1eb896";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script></head><body>
<div class="container">
	<div class="home page">
	       <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	       <div class="bg-size">
	          <img class="home-t1 simg animated fadeInLeft" src="<?php echo $url ?>/img/home-t1.png">
	          <img class="home-t2 simg animated fadeInLeft" src="<?php echo $url ?>/img/home-t2.png">
	          <img class="home-tu1 simg delay-d1s animated fadeInLeft" src="<?php echo $url ?>/img/home-tu1.png">
	          <img class="home-tu2 simg delay-d1s animated fadeInRight" src="<?php echo $url ?>/img/home-tu2.png">
	          <img class="home-tu3 simg delay-d2s animated fadeInLeft" src="<?php echo $url ?>/img/home-tu3.png">
	          <img class="home-tu4 simg delay-d2s animated fadeInRight" src="<?php echo $url ?>/img/home-tu4.png">
	          <img class="home-more simg delay-d5s fadeIn  animated" src="<?php echo $url ?>/img/home-more.png">
	        
	       </div>
	</div>
	<div class="p2 page">
	   <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	   <img class="p2-t1 simg animated fadeInRight" src="<?php echo $url ?>/img/p2-t1.png">
	   <div class="bg-size">
	         <img class="p2-t2 simg animated fadeInLeft" src="<?php echo $url ?>/img/p2-t2.png">
	         <img class="p2-t3 simg animated fadeInLeft" src="<?php echo $url ?>/img/p2-t3.png">
	         <img class="p2-t4 simg delay-d2s animated fadeIn" src="<?php echo $url ?>/img/p2-t4.png">
	         
	   </div>
	</div>
	
	<div class="p3 page">
	   <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	   <div class="bg-size">
	   	<img class="p3-t1 simg animated fadeInLeft" src="<?php echo $url ?>/img/p3-t1.png">
	   	<img class="p3-t2 simg animated fadeIn delay-d2s" src="<?php echo $url ?>/img/p3-t2.png">
	   	<img class="p3-xp simg animated fadeIn delay-d5s" src="<?php echo $url ?>/img/p3-xp.png">
	   	<img class="p3-gw simg animated fadeIn delay-d5s" src="<?php echo $url ?>/img/p3-gw.png">
	   	<img class="p3-fy simg animated fadeIn delay-d5s" src="<?php echo $url ?>/img/p3-fy.png">
	   
	   </div>
	
	</div>
	
	<div class="p4 page">
	   <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	   <img class="p2-t1 simg animated fadeInRight" src="<?php echo $url ?>/img/p2-t1.png">
	   <div class="bg-size">
	   	 <img class="p4-t2 simg animated fadeInLeft" src="<?php echo $url ?>/img/p4-t2.png">
	   	 <img class="p4-t3 simg animated fadeInLeft" src="<?php echo $url ?>/img/p4-t3.png">
	   	 <img class="p4-b1 simg animated fadeInLeft" src="<?php echo $url ?>/img/p4-b1.png">
	   	 <img class="p4-b2 simg animated fadeInLeft" src="<?php echo $url ?>/img/p4-b2.png">
	     <img class="p4-back simg animated fadeInLeft" src="<?php echo $url ?>/img/me-b1.png">
	    </div>
	
	</div>
	
	<div class="p5 page">
	   <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	   <img class="p2-t1 simg animated fadeInRight" src="<?php echo $url ?>/img/p2-t1.png">
	   <div class="bg-size">
	      <img class="p5-t1 simg animated fadeInLeft" src="<?php echo $url ?>/img/p5-t1.png">
	      <img class="p5-t2 simg animated fadeInLeft" src="<?php echo $url ?>/img/p5-t2.png">
	      <img class="p5-t3 simg animated fadeInLeft" src="<?php echo $url ?>/img/p5-t3.png">
	      <img class="p5-b1 simg animated fadeInLeft" src="<?php echo $url ?>/img/p5-b1.png">
	   
	   </div>
	
	</div>
	
	<div class="chou page">
	   <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	   <img class="p2-t1 simg animated fadeInRight" src="<?php echo $url ?>/img/p2-t1.png">
	   <div class="bg-size">
	   	  <img class="chou-t1 simg animated fadeInLeft" src="<?php echo $url ?>/img/chou-t1.png">
	   	  <div class="chou-t2" ></div>
	   	  <div class="chou-cishu">您今天还有 <span class="cishu">1</span> 次抽奖机会</div>
	   	  <img class="chou-t3 simg" src="./img/chou-t3.png">
	   	  <div class="chou-border simg">
	   	       <img class="c-1 c-p c-d1 simg" data-id="2" src="./img/c-d.png">
    	       <img class="c-1 c-p simg" src="./img/c-2.png">
    	       <img class="c-2 c-p c-d2 simg" data-id="1" src="./img/c-d.png">
    	       <img class="c-2 c-p simg" src="./img/c-1.png">
    	       <img class="c-3 c-p c-d3 simg" data-id="5" src="./img/c-d.png">
    	       <img class="c-3 c-p simg" src="./img/c-5.png">
    	       <img class="c-4 c-p c-d4 simg" data-id="3" src="./img/c-d.png">
    	       <img class="c-4 c-p simg" src="./img/c-3.png">
    	       <img class="c-5 c-p c-d5 simg" data-id="4" src="./img/c-d.png">
    	       <img class="c-5 c-p simg" src="./img/c-4.png">
    	       <img class="c-6 c-p c-d6 simg" data-id="3" src="./img/c-d.png">
    	       <img class="c-6 c-p simg" src="./img/c-3.png">
    	       <img class="c-7 c-p c-d7 simg" data-id="5" src="./img/c-d.png">
    	       <img class="c-7 c-p simg" src="./img/c-5.png">
    	       <img class="c-8 c-p c-d8 simg" data-id="4" src="./img/c-d.png">
    	       <img class="c-8 c-p simg" src="./img/c-4.png">
    	       <img class="c-start simg" src="./img/c-start.png">  
	   	  
	   	  </div>
	   	  <img class="chou-b1 simg" src="./img/chou-b1.png">  
	   	  <img class="chou-b2 simg" src="./img/chou-b2.png">
	   	  
	   
	   </div>
	
	</div>
	
	<div class="me page">
	   <img class="p-bg simg" src="<?php echo $url ?>/img/me.jpg?v=2">
	   <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	   <img class="p2-t1 simg animated fadeInRight" src="<?php echo $url ?>/img/p2-t1.png">
	   <div class="bg-size">
	     <img class="me-t1 simg animated fadeInLeft" src="<?php echo $url ?>/img/me-t1.png">
	     <div class="me-t2">
	         <div class="me-j">
	        
	         </div>
	     </div>
	     <img class="me-b1 simg animated fadeInLeft" src="<?php echo $url ?>/img/me-b1.png">
	   </div>
	</div>
	
	<div class="reg page">
	   <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	   <div class="bg-size">
	     <img class="p2-t1 simg animated fadeInRight" src="<?php echo $url ?>/img/p2-t1.png">
	     <img class="reg-t1 simg" src="<?php echo $url ?>/img/reg-t1.png">
	     <div class="reg-t3">
	        <img class="reg-tcode simg" src="<?php echo $url ?>/img/reg-tx1.png">
    	    <div class="reg-txt">0秒</div>
    	    <div class="reg-send simg"></div>
    	    <input id="reg-name" class="txt" name="name" type="text" value="" />
    	    <input id="reg-phone" class="txt" name="phone" type="number" value="" />
    	    <input id="reg-code" class="txt" name="phone" type="number" value="" />
    	    <div class="citypicker" id="distpicker">
    	    <select id="province" name="province"></select>
    	    <select id="city" name="city" ><option value=""></option></select>
    	    </div>
    	    <img class="reg-b1 simg animated " src="<?php echo $url ?>/img/reg-b1.png">
    	    <img class="reg-b2 simg animated " src="<?php echo $url ?>/img/reg-b2.png">
	     
	     </div>
	     
	     
	     
	   </div>
	</div>
	
	<div class="p9 page">
	   <img class="p-logo simg animated fadeInDown" src="<?php echo $url ?>/img/logo.png">
	   <img class="p2-t1 simg animated fadeInRight" src="<?php echo $url ?>/img/p2-t1.png">
	   <div class="bg-size">
	     <img class="p9-t1 simg animated fadeInLeft" src="<?php echo $url ?>/img/p9-t1.png">
	     <img class="p9-t2 simg animated fadeIn" src="<?php echo $url ?>/img/p9-t2.png">
	     <img class="p9-b1 simg animated fadeInLeft delay-d1s" src="<?php echo $url ?>/img/p9-b1.png">
	     <img class="p9-back simg animated fadeInLeft delay-d2s" src="<?php echo $url ?>/img/me-b1.png">
	   </div>
	</div>
	
	
	 
	<div class="t-bg"></div>
	<div class="t-jp">
	    <img class="tjp-t1 simg" src="http://cdn.mei94.com/p/doc/d4/img/tp-4.png">
	</div> 
	 
    <div class="toast">
        <div class="text-wrapper"></div>      
    </div>
</div>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://cdn.mei94.com/web/js/pxloader-images.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script src="<?php echo $url; ?>/city/d.js"></script>
<script>
_h=h= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var sWidth = parseInt((window.innerWidth > 0) ? window.innerWidth : screen.width);
if(sWidth>750){sWidth=750;}
var _rate=(sWidth/750);
if(h<500){h=500;}
var _img=['bg.jpg'];
var loader = new PxLoader();
for(var i=0; i<_img.length; i++){loader.addImage('./img/'+_img[i]);}
loader.start();
loader.addCompletionListener(function(e){
 $(".home").show().addClass("fade-in");
});
var _hasReg=<?php echo $hasReg; ?>;
$(function(){
 
$('.container, .page').width(sWidth).height(h);
$('.p-bg').width(sWidth).height(_rate*1222);
$('.p-logo').width(_rate*267).height(_rate*73).css({"top":0, "left":0});
$('.home-t1').width(_rate*620).height(_rate*144).css({"top":_rate*95, "left":0});
$('.home-t2').width(sWidth).height(_rate*392).css({"top":_rate*200, "left":0});
$('.home-tu1, .home-tu3').width(_rate*375).height(_rate*255);
$('.home-tu1').css({"top":_rate*598, "left":0});
$('.home-tu2').width(_rate*375).height(_rate*253).css({"top":_rate*598, "left":_rate*372});
$('.home-tu3').css({"top":_rate*852, "left":0});
$('.home-tu4').width(_rate*375).height(_rate*257).css({"top":_rate*852, "left":_rate*372});
$('.home-more').width(_rate*284).height(_rate*76).css({"top":_rate*1118, "left":_rate*232});
$('.p2-t1').width(_rate*222).height(_rate*115).css({"top":0, "left":_rate*528});
$('.p2-t2').width(_rate*633).height(_rate*143).css({"top":_rate*144, "left":_rate*0}); 
$('.p2-t3').width(_rate*642).height(_rate*767).css({"top":_rate*314, "left":_rate*0});
$('.p2-t4').width(_rate*289).height(_rate*84).css({"top":_rate*1100, "left":_rate*228});

$('.p3-t1').width(sWidth).height(_rate*418).css({"top":_rate*124, "left":0});
$('.p3-t2').width(sWidth).height(_rate*438).css({"top":_rate*602, "left":0});
$('.p3-xp').width(_rate*240).height(_rate*89).css({"top":_rate*1052, "left":_rate*24});
$('.p3-gw').width(_rate*227).height(_rate*89).css({"top":_rate*1052, "left":_rate*260});
$('.p3-fy').width(_rate*228).height(_rate*89).css({"top":_rate*1052, "left":_rate*488});
$('.p4-t2').width(_rate*312).height(_rate*152).css({"top":_rate*178, "left":_rate*214});
$('.p4-t3').width(sWidth).height(_rate*497).css({"top":_rate*348, "left":0});
$('.p4-b1').width(_rate*414).height(_rate*80).css({"top":_rate*866, "left":_rate*166});
$('.p4-b2').width(_rate*414).height(_rate*84).css({"top":_rate*966, "left":_rate*166});
$('.p4-back').width(_rate*286).height(_rate*83).css({"top":_rate*1070, "left":_rate*232});


$('.p5-t1').width(_rate*569).height(_rate*155).css({"top":_rate*134, "left":0});
$('.p5-t2').width(_rate*624).height(_rate*83).css({"top":_rate*1034, "left":0});
$('.p5-t3').width(sWidth).height(_rate*840).css({"top":_rate*252, "left":0});
$('.p5-b1').width(_rate*283).height(_rate*74).css({"top":_rate*1122, "left":_rate*234});

$('.me-t1').width(_rate*554).height(_rate*82).css({"top":_rate*202, "left":0});
$('.me-t2').width(_rate*713).height(_rate*786).css({"top":_rate*304});
$('.me-b1').width(_rate*286).height(_rate*83).css({"top":_rate*1100, "left":_rate*234});
$('.me-j').height(_rate*140).css({"top":_rate*52});
$('.me-jtxt').width(_rate*750).height(_rate*67).css({"margin-left":_rate*0});

$('.p9-t1').width(_rate*698).height(_rate*166).css({"top":_rate*44, "left":0});
$('.p9-t2').width(sWidth).height(_rate*775).css({"top":_rate*180, "left":0});
$('.p9-b1').width(_rate*281).height(_rate*69).css({"top":_rate*960, "left":_rate*235});
$('.p9-back').width(_rate*286).height(_rate*83).css({"top":_rate*1050, "left":_rate*232});

$('.chou-cishu').height(_rate*64).css({"top":_rate*310,'line-height':_rate*64+'px'});
$('.chou-t1').width(_rate*590).height(_rate*148).css({"top":_rate*138, "left":0}); 
$('.chou-t2').width(sWidth).height(_rate*742).css({"top":_rate*295, "left":0});
$('.chou-border').width(_rate*626).height(_rate*530).css({"top":_rate*444, "left":_rate*57});



$('.c-p').width(_rate*214).height(_rate*176);
$('.c-1').css({"top":0, "left":0});
$('.c-2').css({"top":0, "left":_rate*208});
$('.c-3').css({"top":0, "left":_rate*418});
$('.c-4').css({"top":_rate*172, "left":_rate*418});
$('.c-5').css({"top":_rate*342, "left":_rate*418});
$('.c-6').css({"top":_rate*342, "left":_rate*208});
$('.c-7').css({"top":_rate*342, "left":0});
$('.c-8').css({"top":_rate*172, "left":0});
$('.c-start').width(_rate*223).height(_rate*182).css({"top":_rate*168, "left":_rate*207});
$('.chou-t3').width(_rate*539).height(_rate*92).css({"top":_rate*1014, "left":0});
$('.chou-b1').width(_rate*286).height(_rate*85).css({"top":_rate*1114, "left":_rate*72});
$('.chou-b2').width(_rate*283).height(_rate*85).css({"top":_rate*1114, "left":_rate*392});
$('.tjp-t1').width(sWidth).height(_rate*563).css({"top":(_h - _rate*563)/2, "left":0}); 

$('.reg-t1').width(_rate*636).height(_rate*80).css({"top":_rate*222, "left":0});
$('.reg-t2').width(_rate*634).height(_rate*142).css({"top":_rate*204, "left":0}); 
$('.reg-t3').width(_rate*702).height(_rate*826).css({"top":_rate*348}); 
$('.reg-b1').width(_rate*279).height(_rate*73).css({"top":_rate*576, "left":_rate*228});
$('.reg-b2').width(_rate*279).height(_rate*74).css({"top":_rate*696, "left":_rate*228});
$('#reg-name').width(_rate*314).height(_rate*70).css({"top":_rate*70, "left":_rate*270});
$('#reg-phone').width(_rate*244).height(_rate*70).css({"top":_rate*156, "left":_rate*270});
$('#reg-code').width(_rate*280).height(_rate*70).css({"top":_rate*242, "left":_rate*306});
$('#province').width(_rate*280).height(_rate*70).css({"top":_rate*330, "left":_rate*306});
$('#city').width(_rate*280).height(_rate*70).css({"top":_rate*410, "left":_rate*306});
$('.reg-tcode').width(_rate*83).height(_rate*56).css({"top":_rate*164, "left":_rate*506});
$('.reg-send').width(_rate*78).height(_rate*74).css({"top":_rate*154, "left":_rate*516});
$('.reg-txt').width(_rate*70).height(_rate*74).css({"top":_rate*154, "left":_rate*516, 'line-height':_rate*74+'px'});
if(h < 590){
  $('.bg-size').css({"zoom":.92, "left":sWidth*0.04});
}
if(h > _rate*1330){
   var _cha= (h - _rate*1222)/2;
   if(_cha > 0){
      $('.bg-size').css({"top":_cha});
   }
}

var _regGo='home';
var _regBackGo='home';
_curId=0;
_lastj=8;
_quan=2;
_jId=4;
_cData=[2,1,5,3,4,3,5,4];
_cq=1;
var _cishu=3;

function _chou(){
    _curId++;
    _quan--;
	if(_curId < 2){
	  _lastj=8;
	}else{
	  _lastj=_curId-1;
	}
    $(".c-d"+_lastj).attr("src",'./img/c-d.png');
    $(".c-d"+_curId).attr("src",'./img/c-d2.png');
    _getId=_cData[_curId-1]; 
    if(_quan < 1 && _jId == _getId){
       $(".t-bg, .t-jp").fadeIn();
       $(".c-start").removeClass("gogray");
       _canStart=true;
       return;
    }
    if(_curId > 7){_curId=0;_cq=_cq+.3;}
	window.setTimeout(function(){
		_chou();
		}, 100*_cq);
}
_canStart=true;
_chouCount=0;
$(".c-start").click(function(){
   if(false == _canStart){return;}  
   if(_cishu<1){
	    _popMsg("您的抽奖次数已用完");
		return;}
	_canStart=false;
	$.post("./api/?c=start", {id:1}, function(data){
		if('work' == data.status){
			_quan=data.q;
			_jId=data.l;
			_cishu--;
			_cq=1;
			$(".tjp-t1").attr("src",'./img/tp-'+data.p+'.png');
			$(".cishu").html(_cishu);
        	$(".c-start").addClass("gogray");
			_chou();
		}
	}, "json");
});
function _popMsg(msg){$(".toast").hide();$(".text-wrapper").html(msg);$(".toast").fadeIn();window.setTimeout(function(){$(".toast").fadeOut();}, 750);}
$('.t-bg, .t-jp').click(function(){
	   $('.t-bg, .t-jp').fadeOut();
	});

$.post("./api/?c=getci", {id:1}, function(data){
    _cishu=data.n;
    $(".cishu").html(data.n);
}, "json");

$(".home-more").click(function(){ 
	$(".home").fadeOut(500);
	$(".p2").fadeIn();
});
$(".p2-t4").click(function(){ 
	$(".p2").fadeOut(500);
	$(".p3").fadeIn();
});

$(".p3-xp").click(function(){
	$(".p3").fadeOut(500);
	$(".p4").fadeIn();
});
$(".p3-gw").click(function(){ 
	$(".p3").fadeOut(500);
	$(".p9").fadeIn();
});
$(".p3-fy").click(function(){ 
	$(".p3").fadeOut(500);
	$(".p5").fadeIn();
});
$(".p5-b1").click(function(){
	if(false == _hasReg){
	      _regGo='chou';
	      _regBackGo='p5';
	      $(".p5").fadeOut();
	      $(".reg").fadeIn();
	      return;
	}
	$(".p5").fadeOut(500);
	$(".chou").fadeIn();
});
$(".chou-b1").click(function(){
	$.post("./api/?c=getmj", {id:1}, function(data){
	    var _html='';
	    var _getData=data.d;
	    for (var id in _getData) {
	        console.log(id+'...'+ _getData[id]);
	        _html+='<img class="me-jtxt" src="<?php echo $url ?>/img/me-j'+id+'.png">';
	    }
	   $(".me-j").hide().html(_html);
	   $('.me-jtxt').width(_rate*586).height(_rate*70).css({"margin-left":_rate*96});
	   $(".me-j").show();
	   $(".chou").fadeOut(500);
	   $(".me").fadeIn();  
	 }, "json");
});
$("#distpicker").distpicker();
function checkTel(tel){return /^1(3|4|5|6|7|8|9)[0-9]\d{8}$/.test(tel)}
function _countDown(){
	_regi--;
	if(_regi<1){
		$('.reg-txt').hide();
		$('.reg-tcode').show();
		_cansendsms=true;
        return;
    }
    $('.reg-txt').html(_regi+'秒');
    window.setTimeout(function(){
    	_countDown();
        }, 1000);
}
var _code='<?php echo $_SESSION['code'] ?>';
console.log(_code);
var _regi=30;
var _cansendsms=true;
$('.reg-send').click(function(){
	if(false == _cansendsms){return;}
	var _phone=$("#reg-phone").val();
	if('' == _phone){
		_popMsg("请输入手机号码");
		return;
    }
	if(false == checkTel(_phone)){
		_popMsg("请输入正确的手机号");
		return;
    }
	_regi=30;
	$('.reg-tcode').hide();
	$('.reg-txt').show();
	_countDown();
	_cansendsms=false;
	$.post("./api/?c=sms", {phone:_phone}, function(data){}, "json");
});
 
$('.reg-b1').click(function(){
	   var _phone=$("#reg-phone").val();
	   var _name=$("#reg-name").val();
	   var _ma=$("#reg-code").val();
	   var _sheng=$('#province').val();
	   var _shi=$('#city').val();
	   var p = /[0-9]/;  
	   if('' == _name){_popMsg("请输入姓名");return;}
	   if(p.test(_name)){_popMsg("请输入正确的姓名");return;}
	   if('' == _phone){_popMsg("请输入手机号码");return;}
	   if(false == checkTel(_phone)){_popMsg("请输入正确的手机号");return;}
	   if('' == _ma){_popMsg("请输入验证码");return;}
	   if(_code != _ma){_popMsg("请输入正确的验证码");return;}
	   if('' == _sheng || null == _sheng){_popMsg("请选择省份");return;}
	   if('' == _shi || null == _shi){_popMsg("请选择地区");return;}
	   $.post("./api/?c=uinfo", {name:_name,phone:_phone,sheng:_sheng,shi:_shi}, function(data){
				_hasReg=true;
				$(".reg, .home").fadeOut();
				$("."+_regGo).fadeIn();
	   }, "json");
	}); 
$('.p4-b1').click(function(){
    window.location.href="http://www.der.com.cn/h5/der/d2108.php?f=spr";
});
$('.p4-b2').click(function(){
    window.location.href="http://derspring.mei94.com/shi/?f=spr";
});
$('.p9-b1').click(function(){
	window.location.href="http://mei94.com/derspring/vip/";
});
$('.chou-b2').click(function(){
	$(".chou").fadeOut();
	$(".p3").fadeIn();
});
$('.me-b1').click(function(){
	$(".me").fadeOut();
	$(".chou").fadeIn();
});
$('.p4-back').click(function(){
	$(".p4").fadeOut();
	$(".p3").fadeIn();
});
$('.p9-back').click(function(){
	$(".p9").fadeOut();
	$(".p3").fadeIn();
});
$('.reg-b2').click(function(){
	$(".reg").fadeOut();
	$("."+_regBackGo).fadeIn();
});
 
wx.config({
	appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,
	nonceStr: '<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',
	jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage','onMenuShareQQ','showMenuItems','showOptionMenu','updateAppMessageShareData','updateTimelineShareData']
});
wx.ready(function (){
	var _link='http://derfyh.mei94.com/';
    var _imgUrl='<?php echo $url ?>/img/64.jpg';
    var _title='天降豪礼 全球狂欢';
    var _desc='第三届“风云惠”年中大促震撼开启';
	wx.updateAppMessageShareData({ 
        title: _title,  
        desc: _desc,  
        link: _link,  
        imgUrl: _imgUrl,  
        success: function () {}
    })
	wx.updateTimelineShareData({ 
            title: _desc, 
            link: _link, 
            imgUrl: _imgUrl,
            success: function () {
            }
    })	

});

});
</script></body></html>